import pytest
from commen.requesthandler import RequestHandler
from commen.demo2 import FileHanlder

class TestClass:
    f1 = FileHanlder()
    data1 = f1.read_excel('commen/data.xlsx', '主题首页')
    data2 = ','.join(data1[0])

    @pytest.mark.parametrize(data2, data1[1:])
    def test_ddt_excel(self,TCNo,TEST_POINT,Automation,test_type,tc_owner,E_resDesc,E_resCode,Method,URL,page,tab,limit,mdrender):
        data = {
            "page": page,
            "tab": tab,
            "limit": limit,
            'mdrender': mdrender
        }
        request = RequestHandler(Method, url=URL)
        r = request.do_request(params=data)
        E_resDesc = r.text
        self.f1.write_excel('commen/data.xlsx', '主题首页', TCNo + 1, self.data1[0].index('E_resDesc') + 1, E_resDesc)
